function [f] = ObjValue(x)
%ObjValue: Objective Function
%% ALL GLOBAL OPTIMA
%% one-dimensional equal minima
% f = 1-sin(5.*pi.*x).^6;
% % d = 1;
% % x_bound = [0,1]
% % OptSet.sol = [0.1;0.3;0.5;0.7;0.9];
% % OptSet.fval = 0;
%% Himmelblau's function
% f = (x(:,1).^2+x(:,2)-11).^2+(x(:,1)+x(:,2).^2-7).^2;
% % d = 2;
% % x_bound = repmat([-6,6],[d,1]);
% % OptSet.sol = [3,2;
% %     -2.805118,3.131312;
% %     -3.779310,-3.283186;
% %     3.584428,-1.848126];
% % OptSet.fval = 0;
%% Modified Rastrigin function
% k = [4,4];
% xn = size(x,1);
% f = sum(10+9.*cos(2.*pi.*repmat(k,[xn,1]).*x),2);
% % d = d;
% % x_bound = repmat([0,1],[d,1]);
% % solutionId = fullfact(k);
% % OptSet.sol = (2.*solutionId-1)./2./repmat(k,[prod(k),1]);
% % OptSet.fval = d;
%% Vincent function
f = 1-mean(sin(10.*log(x)),2);
% d = d;
% x_bound = repmat([0.25,10],[d,1]);
% solutionId = fullfact(ones(1,d).*6);
% OptSet.sol = exp((4.*solutionId-11)./20.*pi);
% OptSet.fval = 0;
%% Shubert function
% [xn,d] = size(x);
% f = zeros(xn,1);
% a = repmat((1:5)',[1,d]);
% for i = 1:xn 
%     f(i) = prod(sum(a.*cos(repmat(x(i,:),[5,1]).*(a+1)+a),1));
% end
% % d = d;
% % x_bound = repmat([-10,10],[d,1]);
% % OptSet.sol = [-7.7083,-7.0835;
% %     -7.7083,-0.8003;
% %     -7.7083,5.4829;
% %     -7.0835,-7.7083;
% %     -7.0835,-1.4251;
% %     -7.0835,4.8581;
% %     -1.4251,-7.0835;
% %     -1.4251,-0.8003;
% %     -1.4251,5.4829;
% %     -0.8003,-7.7083;
% %     -0.8003,-1.4251;
% %     -0.8003,4.8581;
% %     4.8581,-7.0835;
% %     4.8581,-0.8003;
% %     4.8581,5.4829;
% %     5.4829,-7.7083;
% %     5.4829,-1.4251;
% %     5.4829,4.8581];
% % OptSet.fval = -186.7309;


%% MANY LOCAL OPTIMA
%% one-dimensional increasing minima
% f = 1-exp(-2.*log(2).*((x-0.08)./0.854).^2).*(sin(5.*pi.*(x.^(3/4)-0.05)).^6);
% % d = 1;
% % x_bound = repmat([0,1],[d,1]);
%% Six-hump camel back
% f = 4.*((4-2.1.*x(:,1).^2+x(:,1).^4./3).*x(:,1).^2+x(:,1).*x(:,2)+(4.*x(:,2).^2-4).*x(:,2).^2);
% % d = 2;
% % x_bound = [-1.9,1.9;-1.1,1.1]
%% Shekel's foxholes
% a = 16.*(mod(0:24,5)-2);
% b = 16.*(floor((0:24)./5)-2);
% xn = size(x,1);
% f = zeros(xn,1);
% for i = 1:xn
%     temp = 1+(0:24)+(x(i,1)-a).^6+(x(i,2)-b).^6;
%     f(i) = 1./(0.002+sum(1./temp));
% end
% % d = 2;
% % x_bound = repmat([-65.536,65.535],[d,1])
%% Griewank function
% d = size(x,2);
% f = 1+1/4000.*sum(x.^2,2)-prod(cos(x./repmat(sqrt(1:d),[size(x,1),1])),2);
% % d = 2;
% % x_bound = repmat([-5,5],[d,1]);
%% Rastrigin function
% d = size(x,2);
% A = 10;
% f = A*d+sum(x.^2-A.*cos(2.*pi.*x),2);
% % d = d;
% % x_bound = repmat([-5.12,5.12],[d,1]);


%% CONTINUOUS OPTIMA PROBLEMS
%% Schaffer's function
% f = 0.5+(sin(sqrt(sum(x.^2,2))).^2-0.5)./((1+0.001.*(sum(x.^2,2))).^2);
% % d = 2;
% % x_bound = repmat([-10,10],[d,1]);
%% Michalewicz
% f = -sin(x(:,1)).*(sin(x(:,1).^2./pi).^20)+sin(x(:,2)).*(sin(x(:,2).^2.*2./pi).^20);
% % d = 2;
% % x_bound = repmat([0,pi],[d,1]);

end